<template>
  <div class="drivingSchoolItem">
    <div class="drivingSchoolItem_left">
      <div class="imgBox">
        <nuxt-link
          :to="{
            name: 'school-schoolDetails-id',
            query: { schoolId: drivingSchoolItem.id },
          }"
        >
          <img :src="drivingSchoolItem.head_img" alt="" />
    
        </nuxt-link>
         <div class="brand" v-if="drivingSchoolItem.is_vip==1">
           <img src="~/assets/images/brand.png" alt="" >
         </div>
      </div>
      <div class="midText">
        <div class="midText_top">
          <nuxt-link
            :to="{
              name: 'school-schoolDetails-id',
              query: { schoolId: drivingSchoolItem.id },
            }"
          >
            <span class="titleColor curp">{{
              drivingSchoolItem.short_title
            }}</span>
          </nuxt-link>
          <img src="~/assets/images/vip.png" alt=""  style="width:22px;height:20px"  v-if="drivingSchoolItem.is_vip==1"/>
          <img src="~/assets/images/schoolTitle.png" alt="" />
          <img src="~/assets/images/tuijian.png" alt=""  style="width:48px;height:20px"  v-if="drivingSchoolItem.is_recommend==1"/>
          <img src="~/assets/images/hot.png" alt=""  style="width:48px;height:20px"  v-if="drivingSchoolItem.is_hot==1"/>
        </div>
        <span class="tips"> 驾校地址： {{ drivingSchoolItem.address }} </span>
        <div class="starTextBox">
          <div class="starBox">
            <img
              src="~/assets/images/rankstar.png"
              alt=""
              v-for="num in drivingSchoolItem.cAvg"
              :key="num"
            />
            <img
              v-if="drivingSchoolItem.cAvg < 5"
              src="~/assets/images/rankstarhui.png"
              alt=""
              v-for="(hui, huii) in 5 - drivingSchoolItem.cAvg"
              :key="huii"
            />
          </div>
          <span class="tips">{{ drivingSchoolItem.cCount }}人点评 </span>
          <div class="people">
            <img src="~/assets/images/people.png" alt="" />
            <span class="tips">{{ drivingSchoolItem.sCount }}人 </span>
          </div>
        </div>
        <nuxt-link :to="{ name: 'school-schoolDetails-id' , query: { schoolId: drivingSchoolItem.id }}" class="textHide">
          <span class="tips curp">
            班型： <span v-for="item,i in drivingSchoolItem.package" :key="i" style="margin-right:10px">{{item}}</span>
          </span>
        </nuxt-link>
      </div>
    </div>
    <div class="drivingSchoolItem_right">
      <span class="money">{{ drivingSchoolItem.cost }}</span>
      <div class="jianBox">
        <img src="~/assets/images/jian.png" alt="" />
        <span class="tips">学车立减100元</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    drivingSchoolItem: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  methods: {},
};
</script>

<style scoped lang='scss'>
.drivingSchoolItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 30px;
  .drivingSchoolItem_left {
    display: flex;
    align-items: center;
  }
  .imgBox {
    flex-shrink: 0;
    width: 168px;
    height: 112px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 20px;
    position: relative;
    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .brand{
      position: absolute;
      width: 100%;height: 24px;
      left: 0;
      top:0;
      z-index: 2;
      display: flex;
      align-items: center;
      img{
        width: 48px ;height: 20px;margin-right: 10px;
      }
    }
  }
  .midText {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    margin-right: 20px;
    .midText_top {
      display: flex;
      align-items: center;
      margin-bottom: 12px;
      .titleColor {
        font-size: 24px;
      }
      img {
        width: 19px;
        height: 20px;
        margin-left: 12px;
      }
    }
    .textHide{
      font-size: 14px;
      max-width: 465px;
      word-wrap: break-word;
      white-space: nowrap;
      /*强制不换行，如果没有此行，则当用鼠标滑过的效果时，有可能会出现，因为超出的部分已经漂浮到其他的div上了*/
      overflow: hidden;
      /*自动隐藏文字*/
      text-overflow: ellipsis;
    }
    .tips {
      font-size: 14px;
      max-width: 465px;
      word-wrap: break-word;
      white-space: nowrap;
      /*强制不换行，如果没有此行，则当用鼠标滑过的效果时，有可能会出现，因为超出的部分已经漂浮到其他的div上了*/
      overflow: hidden;
      /*自动隐藏文字*/
      text-overflow: ellipsis;
    }
    .starTextBox {
      margin: 10px 0;
      display: flex;
      align-items: center;
      .starBox {
        display: flex;
        align-items: center;
        img {
          margin-right: 6px;
        }
      }
      .tips {
        margin-right: 15px;
      }
      .people {
        display: flex;
        align-items: center;
        img {
          margin-right: 5px;
        }
      }
    }
  }
  .drivingSchoolItem_right {
    width: 150px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    .money {
      font-size: 24px;
      color: #ff6054;
    }
    .jianBox {
      display: flex;
      align-items: center;
      margin-top: 8px;
    }
    .tips {
      font-size: 16px;
      margin-left: 5px;
      
    }
  }
}
</style>